package ccm.itesm.mx.servicios;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

public class Servicio implements Serializable {
	
	private static final long serialVersionUID = 7526471155622776147L;
	
	private String nombreServ;
	private int idServ;
	
	public Servicio(String nombreServ, int idServ){
		this.nombreServ = nombreServ;
		this.idServ = idServ;
	}
	
	public String getNombre(){
		return nombreServ;
	}
	
	public int getId(){
		return idServ;
	}
	
	public void setNombre(String in){
		nombreServ = in;
	}
	
	public void setId(int in){
		idServ = in;
	}
	
	public String toString(){
		return nombreServ;
	}
	
	private void readObject(ObjectInputStream aInputStream) throws ClassNotFoundException, IOException {
		//always perform the default de-serialization first
		aInputStream.defaultReadObject();
	}

	private void writeObject(ObjectOutputStream aOutputStream) throws IOException {
		//perform the default serialization for all non-transient, non-static fields
		aOutputStream.defaultWriteObject();
	}

}
